#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>
#include<assert.h>
#include<stdbool.h>

char* mystrstr(const char* str1, const char* str2)
{
	assert(str1 && str2);
	char* p = (char*)str1;
	char* s1 = (char*)str1, * s2 = (char*)str2;
	while (*p != '\0' && p)
	{
		s1 = p;
		s2 = (char*)str2;
		while (*s1 == *s2 && (*s1 != '\0' && *s2 != '\0'))
		{
			s1++;
			s2++;
		}
		if (*s2 == '\0')
			return p;
		p++;
	}
	if (*s1 == *s2 && *s2 == '\0')
		return s1;
	return NULL;
}

void f5()
{
	char a[30] = { "abcdef" };
	char b[20] = { "bcd" };
	int i = 0;
	if (strstr(a, b) != NULL)
		printf("yes\n");
	else
		printf("no\n");
	if (mystrstr(a, b) != NULL)
		printf("yes\n");
	else
		printf("no\n");
}

int main()
{
	return 0;
}

